// install spmap
cap ssc install spmap

// load data
use data/maps.dta, clear

// merge coordinates
merge 1:1 ADM3_PCODE using "data/vzla_shapefiles/vzla_adm3.dta"
replace visited = 0 if _merge == 2 // Map classification has 3 non-visited parishes
replace focal = 0 if _merge == 2
drop _merge

// produce map - visits
spmap visited using "data/vzla_shapefiles/vzla_adm3_coord.dta" ///
			, id(adm3_pcode) cln(5) fcolor(Paired) ///
			ocolor(gs2 ..) osize(0.03 ..) ///
			legend(size(2.5)) legstyle(2) ///
			polygon(data("data/vzla_shapefiles/vzla_adm1_coord.dta") ///
			ocolor(black) osize(0.2) legenda(on) legl("States")) ///
			legtitle("Visited:") legend(label(3 "Yes") label(2 "No")) 
graph export figs/fig01_A.png, replace	

// produce map - focal
spmap focal using "data/vzla_shapefiles/vzla_adm3_coord.dta" ///
			, id(adm3_pcode) cln(5) fcolor(Paired) ///
			ocolor(gs2 ..) osize(0.03 ..) ///
			legend(size(2.5)) legstyle(2) ///
			polygon(data("data/vzla_shapefiles/vzla_adm1_coord.dta") ///
			ocolor(black) osize(0.2) legenda(on) legl("States")) ///
			legtitle("Focal:") legend(label(3 "Yes") label(2 "No")) 		
graph export figs/fig01_B.png, replace		
